<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<script>
    function idCardChange() {
        var idNO = $("#idNo").val();
        if (idNO != null && idNO != '') {//根据身份证计算年龄
            var myDate = new Date();
            var month = myDate.getMonth() + 1;
            var day = myDate.getDate();
            var age = myDate.getFullYear() - idNO.substring(6, 10) - 1;
            if (idNO.substring(10, 12) < month || idNO.substring(10, 12) == month && idNO.substring(12, 14) <= day) {
                age++;
            }
            $("#age").val(age);
        }
    }

</script>
<div class="content-wrap">
    <div class="wrapper" style="bottom: 50px;">
<ul class="nav nav-tabs">
    <li>
        <a href="#"  onclick="loadDiv('mainCenterDiv','${ctx}/doctor/liveRequisition/hospitalRegistr')">入院登记</a>
    </li>
    <li class="active">
        <a href="#" >
          修改基本信息
        </a>
    </li>
</ul>
<section class="panel">
    <div class="panel-body">
        <form:form id="inputForm" class="form-horizontal" modelAttribute="patVisitIndex"
              onsubmit="return formSaveLoad('mainCenterDiv','inputForm','${ctx}/doctor/patVisitIndex/savePatient','${ctx}/doctor/liveRequisition/hospitalRegistr');">
            <input type="hidden" name="id" value="${patVisitIndex.id}"/>
            <div class="form-group">
                <label class="col-sm-2 control-label">患者姓名：</label>
                <div class="col-sm-4">
                    <input name="name" value="${patVisitIndex.name}" data-parsley-validate="true"
                           htmlEscape="false" class="form-control" maxlength="40"/>
                </div>
                <label class="col-sm-2 control-label">性别：</label>
                <div class="col-sm-4">
                    <sys:select checkValue="${fns:getDictLabels(patVisitIndex.sex, 'SEX_DICT', '')}"
                                lists="${fns:getDictList('SEX_DICT')}" className="form-control" name="sex"></sys:select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">身份证号：</label>
                <div class="col-sm-4">
                    <input name="idNo" id="idNo" value="${patVisitIndex.idNo}"   data-parsley-checkidcard="3" onblur="idCardChange()"
                           htmlEscape="false" class="form-control" maxlength="18"/>
                </div>
                <label class="col-sm-2 control-label">电话：</label>
                <div class="col-sm-4">
                    <input name="phone" value="${patVisitIndex.phone}" data-parsley-validate="true" data-parsley-mobilephone="3"
                           htmlEscape="false" class="form-control" maxlength="40"/>
                </div>
            </div>
            <div class="form-group" >
                <label class="col-sm-2 control-label">医保住院登记号：</label>
                <div class="col-sm-4">
                    <input name="residenceNo" value="${patVisitIndex.residenceNo}" data-parsley-validate="true"  htmlEscape="false" class="form-control"  maxlength="40" />
                </div>
                <label class="col-sm-2 control-label">年龄：</label>
                <div class="col-sm-4">
                    <input name="age" id="age" value="${patVisitIndex.age}"   data-parsley-type="number"
                           htmlEscape="false" class="form-control" maxlength="3"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">患者费别：</label>
                <div class="col-sm-4">
                    <sys:select checkValue="${patVisitIndex.chargeType}"
                                lists="${fns:getDictList('CHARGE_TYPE_DICT')}" className="form-control"
                                name="chargeType"></sys:select>
                </div>
                <label class="col-sm-2 control-label">身份：</label>
                <div class="col-sm-4">
                    <sys:select checkValue="${patVisitIndex.identity}"
                                lists="${fns:getDictList('PROFESSION_DICT')}" className="form-control"
                                name="identity"></sys:select>

                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">民族：</label>
                <div class="col-sm-4">
                    <sys:select checkValue="${patVisitIndex.nation}"
                                lists="${fns:getDictList('NATION_DICT')}" className="form-control"
                                name="nation"></sys:select>

                </div>
                <label class="col-sm-2 control-label">婚姻：</label>
                <div class="col-sm-4">
                    <sys:select checkValue="${patVisitIndex.marriage}"
                                lists="${fns:getDictList('MARRIAGE_DICT')}" className="form-control"
                                name="marriage"></sys:select>
                </div>
            </div>

            <div class="form-group">

                <label class="col-sm-2 control-label">国籍：</label>
                <div class="col-sm-4">
                    <sys:select checkValue="${patVisitIndex.nationality}"
                                lists="${fns:getDictList('NATIONALITY_DICT')}" className="form-control"
                                name="nationality"></sys:select>

                </div>

                <label class="col-sm-2 control-label">籍贯：</label>
                <div class="col-sm-4">
                    <input name="nativePlace" data-parsley-validate="true" value="${patVisitIndex.nativePlace}"
                           htmlEscape="false" class="form-control" maxlength="40"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">邮编：</label>
                <div class="col-sm-4">
                    <input name="zipCode" value="${patVisitIndex.zipCode}" data-parsley-validate="true"
                           htmlEscape="false" class="form-control" maxlength="40"/>
                </div>

                <label class="col-sm-2 control-label">出生地：</label>
                <div class="col-sm-4">
                    <input name="homeplace" data-parsley-validate="true" value="${patVisitIndex.homeplace}"
                           htmlEscape="false" class="form-control" maxlength="40"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">现住址：</label>
                <div class="col-sm-4">
                    <input name="address" value="${patVisitIndex.address}" data-parsley-validate="true"
                           htmlEscape="false" class="form-control" maxlength="40"/>
                </div>
                <label class="col-sm-2 control-label">联系人：</label>
                <div class="col-sm-4">
                    <input name="contacts" value="${patVisitIndex.contacts}" data-parsley-validate="true"
                           htmlEscape="false" class="form-control" maxlength="40"/>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">联系人关系：</label>
                <div class="col-sm-4">
                    <sys:select checkValue="${patVisitIndex.contactsRelation}" name="contactsRelation" lists="${fns:getDictList('RELATIONSHIP_DICT')}" className="form-control" ></sys:select>
                </div>
                <label class="col-sm-2 control-label">联系人地址：</label>
                <div class="col-sm-4">
                    <input name="contactsAddress" value="${patVisitIndex.contactsAddress}" data-parsley-validate="true"
                           htmlEscape="false" class="form-control" maxlength="40"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存">&nbsp;
                    <input id="btnCancel" class="btn" type="button" value="返 回"
                           onclick="loadDiv('mainCenterDiv','${ctx}/doctor/liveRequisition/hospitalRegistr')">
                </div>
            </div>

        </form:form>
    </div>
</section>
    </div>
</div>